import { Component, OnInit } from '@angular/core';
import {AwardService} from "../svrs/award.service";
import {Award } from "../svrs/domain";
import {ActivatedRoute} from "@angular/router";

@Component({
  selector: 'app-prize',
  templateUrl: './prize.component.html',
  styleUrls: ['./prize.component.css']
})
export class PrizeComponent {
indexs;
  awards:Award[];

  constructor(private svr:AwardService,private aRouter:ActivatedRoute){
    aRouter.params.subscribe(pars=>{
      if(pars && pars.awardId2){
        this.indexs=parseInt(pars.awardId2);
      }
    })

    this.svr.getawards().subscribe(
      (data)=>{
        this.awards=data;
      }
    )

  }

}
